package com.mz.ozy.adapter;


import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;
import androidx.viewpager.widget.PagerAdapter;

import com.mz.ozy.activity.me.MyOrderFragment;

/**
 * Created by Administrator on 2018/4/17.
 * 我的订单
 */

public class MyOrderFragmentAdapter extends FragmentStatePagerAdapter {


    public MyOrderFragmentAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {

        switch (position) {
            case 0:
                return MyOrderFragment.newInstance(MyOrderFragment.TYPE_ALL,position);
            case 1:
                return MyOrderFragment.newInstance(MyOrderFragment.TYPE_PAY,position);
            case 2:
                return MyOrderFragment.newInstance(MyOrderFragment.TYPE_SEND,position);
            case 3:
                return MyOrderFragment.newInstance(MyOrderFragment.TYPE_RECEIVE,position);
            case 4://预留评价功能
                return MyOrderFragment.newInstance(MyOrderFragment.TYPE_REFUND,position);
            default:
                return null;
        }
    }

    @Override
    public int getItemPosition(Object object) {
        return PagerAdapter.POSITION_NONE;
    }

    @Override
    public int getCount() {
        return 5;
    }

}
